<template>
  <uni-nav-bar title="联系我们" left-icon="left" @clickLeft="redirectTo('index/mine')" :fixed="true" statusBar></uni-nav-bar>
  <view class="contact_top">
    <view>服务热线</view>
    <view>{{ userinfo.des }}</view>
    <view>{{ userinfo.phone }}</view>
    <view @click="telCall(userinfo.phone)">立即拨打</view>
  </view>
  <view class="contact_top" style="height: 159rpx; align-items: flex-start">
    <view style="font-size: 30rpx; color: #333333">工作时间：{{ userinfo.time }}</view>
    <view style="font-size: 30rpx; color: #333333">公司邮箱：{{ userinfo.email }}</view>
  </view>
</template>

<script setup lang="ts">
import { authorMe } from '@/gql/user';
import { redirectTo } from '@/utils/navigator';
import { showLoading } from '@/utils/prompt';
	import { telCall } from '@/utils/copyText';
import { toPublish } from '@mqtt';
import { ref } from 'vue';
/**
 * 关于我们的信息
 * @param userinfo  关于我们的全部信息
 * @param userinfo.des  详细信息
 * @param userinfo.phone  联系电话
 * @param userinfo.time  工作时间
 * @param userinfo.email  公司邮箱
 */
let userinfo = ref({
  des: '',
  phone: null as number,
  time: '',
  email:'',
});
/**
 * 初始化获取关于我们的信息
 */
function init() {
  showLoading('加载中');
  const payload = {
    query: authorMe,
    variables: {
      code: 'lxwm',
    },
  };
  toPublish('ql/driver/getMyblock', payload, (obj: any) => {
    const { get_myblock } = obj.data;
    userinfo.value = JSON.parse(get_myblock.content);
  });
}
init();
</script>

<style scoped lang="less">
@import url('../mine/less/contactUs.less');
</style>
